import request from '@/utils/request'

//查询收货信息列表
export function getPurchaseOrders(data) {
  return request({
    url: '/back/web/receiveList',
    method: 'post',
    data: data
  })
}

/**
 *
 * @param type 1.获取批次号2.获取采购单号
 * @returns {AxiosPromise}
 */
export function getOrderNo(data) {
  return request({
    url: '/core/busPurchaseOrder/getOrderNo',
    method: 'post',
    data: data
  })
}

export function addPurchaseOrder(data) {
  return request({
    url: '/web/pda/receiveAdd',
    method: 'post',
    data: data
  })
}

export function updatePurchaseOrder(data) {
  return request({
    url: '/back/web/receiveUpdate',
    method: 'post',
    data: data
  })
}


export function delPurchaseOrder(data) {
  return request({
    url: '/core/busPurchaseOrder/del',
    method: 'post',
    data: data
  })
}

export function getToReleaseList(data) {
  return request({
    url: '/core/busTagId/toRelease',
    method: 'post',
    data: data
  })
}

export function getLabelToIssue(data) {
  return request({
    url: '/core/busTagId/release',
    method: 'post',
    data: data
  })
}

export function confirmLabelIssue(data) {
  return request({
    url: '/core/busTagId/releaseOK',
    method: 'post',
    data: data
  })
}

export function downExcelTemplate() {
  return process.env.VUE_APP_BASE_API + '/core/busPurchaseOrder/downExcelTemplate'
}

export function getImportAction() {
  return process.env.VUE_APP_BASE_API + '/core/busPurchaseOrder/importExcel'
}

